package com.yzh.wanandroid.vm

import android.app.Application
import android.util.Log
import androidx.paging.Pager
import androidx.paging.PagingConfig
import com.yzh.wanandroid.base.BaseFragmentViewModel
import com.yzh.wanandroid.model.NetWorkData
import com.yzh.wanandroid.repository.datasource.ListRepository
import com.yzh.wanandroid.utils.PAGER_PUBLIC

class WxArticleFragmentVm(application: Application) : BaseFragmentViewModel(application) {

    private val TAG = "WxArticleFragmentVm"

    var netWorkData = NetWorkData()

    fun getData(id:Int) = Pager(PagingConfig(pageSize = 1)) {
        Log.i(TAG,"PagingConfig id = $id")
        ListRepository(PAGER_PUBLIC,id)
    }.flow
}